/**
 * Created by Administrator on 2016/4/13/0013.
 */
var curIndex = 0, //当前index
    imgLen =0; //图片总数

function autoChangeAgain(){
    imgLen= $(".imgList li").length;
    autoChange = setInterval(function(){
        if(curIndex < imgLen-1){
            curIndex ++;
        }else{
            curIndex = 0;
        }
        //调用变换处理函数
        changeTo(curIndex);
    },3000);
}
var autoChange = setInterval(function(){
    imgLen= $(".imgList li").length;
    if(curIndex < imgLen-1){
        curIndex ++;
    }else{
        curIndex = 0;
    }
    //调用变换处理函数
    changeTo(curIndex);
},3000);
//左箭头点击处理
function previousLink()
{
    //根据curIndex进行上一个图片处理
    curIndex = (curIndex > 0) ? (--curIndex) : (imgLen - 1);
    changeTo(curIndex);
}

//右箭头点击处理
function  nextLinkFun()
{
    curIndex = (curIndex < imgLen - 1) ? (++curIndex) : 0;
    changeTo(curIndex);
}
function changeTo(num){
    $('.imgList').children('li:eq('+num+')').show().siblings('li').hide();
}
$(".imgList li").hover(function(){
    alert(1);
});

function stop()
{
    clearInterval(autoChange);
}
function start()
{
    autoChangeAgain();
}